package constraints

type IList[V comparable] interface {
	Add(items ...V)
	AddConf(cond func(index int, item V) bool, items ...V)
	Set(index int, val V)
	SetList(val []V)
	At(index int) V
	Clear()
	Dispose()
	Clone() *List[V]
	Contains(item V) bool
	ContainsCond(cond func(index int, item V) bool) bool
	CountCond(cond func(index int, item V) bool) int
	Every(cond func(index int, item V) bool) bool
	First(cond func(index int, item V) bool) (val V, has bool)
	Filter(cond func(index int, item V) bool) *List[V]
	ForRange(handler func(index int, item V) error)
	IndexOfConf(cond func(index int, item V) bool) int
	IndexOf(item V) int
	Last(cond func(index int, item V) bool) (val V, has bool)
	Length() int
	Pop() V
	Push(item V)
	PushList(val IList[V])
	Remove(item V)
	RemoveAt(i int)
	Replace(i int, item V)
	Reverse()
	Shift() V
	Slice() []V
	Self() *List[V]
	Sort(compare func(a, b V) int)
	Unshift(item V)
	Unique() *List[V]
	UniqueByCustomKey(getKey func(item V) string) *List[V]
	Union(a IList[V]) *List[V]
	UnionByCustomKey(a IList[V], getKey func(a V) string) *List[V]

	GroupByCount(count int) (r []*List[V])
	GroupByCustomKey(getKey func(item V) string) map[string]*List[V]
}
